package com.rd.sys.dto.commmon.enums;

import java.util.HashMap;
import java.util.Map;

import baseproj.common.constants.BaseEnum;

/**
 * The Class OperatorEnum.
 * 
 * @ClassName: OperatorEnum
 * @Description: 操作员枚举
 * @author:
 * @date: 2014-1-6 上午11:03:47
 */
public class OperatorEnum {

    /**
     * 操作员类型枚举.
     * <p>
     * 0，1为op默认，其他数字预留
     */
    public enum OperatorType implements BaseEnum {

        /** The Operator. */
        Operator("0", "Group"), // 只选角色，不选地域,地域默认为 Group

        /** The Opco. */
        Opco("1", "OPCO"); // 选角色、选地域，地域只能选择二级地域

        /** The code. */
        public String code;

        /** The name. */
        public String name;

        /**
         * Instantiates a new operator type.
         * 
         * @param code
         *            the code
         * @param name
         *            the name
         */
        OperatorType(String code, String name) {
            this.code = code;
            this.name = name;
        }

        /** The code map. */
        public static Map<String, String> codeMap = new HashMap<String, String>();
        static {
            for (int i = 0; i < values().length; i++) {
                codeMap.put(values()[i].code, values()[i].name);
            }
        }

        /**
         * Gets the code.
         * 
         * @return the code
         */
        @Override
        public String getCode() {
            return code;
        }

        /**
         * Gets the name.
         * 
         * @return the name
         */
        @Override
        public String getName() {
            return name;
        }
    }

    /**
     * The Enum RoleType.
     */
    public enum RoleType implements BaseEnum {
        /** The Group. */
        GROUP("0", "Group"),
        /** The OPCO. */
        OPCO("1", "OPCO");

        /** The code. */
        public String code;

        /** The name. */
        public String name;

        /**
         * Instantiates a new role type.
         * 
         * @param code
         *            the code
         * @param name
         *            the name
         */
        RoleType(String code, String name) {
            this.code = code;
            this.name = name;
        }

        /**
         * Gets the code.
         * 
         * @return the code
         */
        @Override
        public String getCode() {
            return code;
        }

        /**
         * Gets the name.
         * 
         * @return the name
         */
        @Override
        public String getName() {
            return name;
        }
    }

    /**
     * 新增操作员存储过程响应码.
     */
    public enum AddOperResultEnum {

        /** The Success. */
        Success("0", "Success"),
        /** The Not exist user. */
        NotExistUser("1", "NotExistUser"),
        /** The Exist operator. */
        ExistOperator("2", "ExistOperator"),
        /** The Not exist role. */
        NotExistRole("3", "NotExistRole");

        /** The code. */
        public String code;

        /** The name. */
        public String name;

        /**
         * Instantiates a new operator type.
         * 
         * @param code
         *            the code
         * @param name
         *            the name
         */
        AddOperResultEnum(String code, String name) {
            this.code = code;
            this.name = name;
        }

        /**
         * Gets the code.
         * 
         * @return the code
         */
        public String getCode() {
            return code;
        }

        /**
         * Gets the name.
         * 
         * @return the name
         */
        public String getName() {
            return name;
        }
    }

}
